package net.mysoft.budgetsoft.system.service.impl;

import java.util.ArrayList;
import java.util.Map;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;

import javax.annotation.Resource;

//import org.hibernate.mapping.Map;
import org.springframework.stereotype.Service;

import net.mysoft.budgetsoft.system.pagemodel.ToDoInfo;
import net.mysoft.budgetsoft.system.service.ToDoInfoService;
import net.mysoft.budgetsoft.system.dao.ToDoInfoDao;
@Service("toDoInfoService")
public class ToDoInfoServiceImpl implements ToDoInfoService {
	@Resource
	private ToDoInfoDao toDoInfoDao;
	
	@Override
	public List<ToDoInfo> find(ToDoInfo toDoInfo) {
		// TODO Auto-generated method stub
		List<ToDoInfo> list=new ArrayList<ToDoInfo>();
		String sql="select c_name,c_title from tb_user";// String;
		List<Object> toDoList= toDoInfoDao.queryByCallProc("up_my_bill_inte","0000");
		
		for(Object ob:toDoList )
		{
			ToDoInfo toDo=new ToDoInfo();
			//toDo.setC_name(ob[0]);
			Map map = (Map)ob;
			if(map.get("c_orgname")!=null && map.get("c_mk_username")!=null )
			{
				toDo.setC_bill_id(map.get("c_bill_id").toString());
				toDo.setC_status(map.get("c_status").toString());
				toDo.setC_mk_dt(map.get("c_mk_dt").toString());
				toDo.setC_orgname(map.get("c_orgname").toString());
				toDo.setC_mk_username(map.get("c_mk_username").toString());
		        list.add(toDo);
			}
	        

			
		}
		return list;
	}

}
